package com.scsj.supermarket.view.activity.generalizemodel;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.scsj.supermarket.R;
import com.scsj.supermarket.adapter.GeneralizeMembersAdapter;
import com.scsj.supermarket.bean.GeneralizeMembersBean;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * 我推荐的人   推广成员
 */
public class GeneralizeMembersActivity extends BaseActivity {

    private TextView mCountTv;
    private RecyclerView mRecyclerview;
    private RelativeLayout mNullLayout;
    private GeneralizeMembersAdapter generalizeMembersAdapter;

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_generalize_members);
        //  ScreenAdapterTools.getInstance().loadView((ViewGroup)getWindow().getDecorView());
        //ScreenAdapterTools.getInstance().reset(this);//如果希望android7.0分屏也适配的话,加上这句
        initToolbar();
        setToolbarTitle("推广成员");
        hasBack(true);
        initView();
    }

    @Override
    protected void initView() {

        mCountTv = (TextView) findViewById(R.id.count_tv);
        mRecyclerview = (RecyclerView) findViewById(R.id.recyclerview);
        mNullLayout = (RelativeLayout) findViewById(R.id.null_layout);
        mRecyclerview.setNestedScrollingEnabled(false);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {
        List list = new ArrayList<GeneralizeMembersBean>();
        for (int i = 0; i < 10; i++) {
            list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "18739911816", "2017-6-18"));
        }
        list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "15516562325", "2017-6-28"));
        list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "18739911816", "2017-6-10"));
        list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "18739911816", "2017-6-11"));
        list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "18739911816", "2017-6-12"));
        list.add(new GeneralizeMembersBean(R.mipmap.ic_head_portrait, "18739911816", "2017-6-13"));
        generalizeMembersAdapter = new GeneralizeMembersAdapter(list);
        mRecyclerview.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerview.setAdapter(generalizeMembersAdapter);

    }
}
